package com.duoduo.common.entity;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户信息对象 auth_user
 *
 * @author duoduo
 * @date 2023-10-18 09:40:01
 */
@Data
public class AuthUser implements Serializable {

	private static final long serialVersionUID = 1L;

    /**  */
    @JsonProperty("id")
    private Long id;

    /** 用户名 */
    @JsonProperty("nickName")
    private String nickName;

    /** 手机号 */
    @JsonProperty("mobile")
    private String mobile;

    /** 密码 */
    @JsonProperty("password")
    private String password;

    /** 头像url */
    @JsonProperty("headimg")
    private String headimg;

    /** 引用人名称 */
    @JsonProperty("referrerName")
    private String referrerName;

    /** 分数 */
    @JsonProperty("score")
    private Integer score;

    /** 团队计数 */
    @JsonProperty("teamCount")
    private Integer teamCount;

    /** 子计数 */
    @JsonProperty("childCount")
    private Integer childCount;

    /** 分配量 */
    @JsonProperty("distributionAmount")
    private BigDecimal distributionAmount;

    /** 是否认证 */
    @JsonProperty("isCertification")
    private Integer isCertification;

    /** 证书名字 */
    @JsonProperty("isCertificationName")
    private String isCertificationName;

    /** 邀请码 */
    @JsonProperty("invitationCode")
    private String invitationCode;

    /** 今日成就 */
    @JsonProperty("todayAchievement")
    private BigDecimal todayAchievement;

    /** 今日利润 */
    @JsonProperty("todayProfit")
    private Integer todayProfit;

    /** 今日佣金 */
    @JsonProperty("todayCommission")
    private Integer todayCommission;

    /** 总金额 */
    @JsonProperty("amount")
    private BigDecimal amount;

    /** 优惠券 */
    @JsonProperty("eCardNumber")
    private BigDecimal eCardNumber;

    /** 身份VIP */
    @JsonProperty("identityVip")
    private Integer identityVip;

    /** 身份VIP类型 */
    @JsonProperty("identityVipValue")
    private String identityVipValue;

    /** 链接url */
    @JsonProperty("linkUrl")
    private String linkUrl;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @JsonProperty("createTime")
    private Date createTime;
    
    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @JsonProperty("updateTime")
    private Date updateTime;
    
																																														
	public AuthUser(Long id, String nickName, String mobile, String password, String headimg, String referrerName, Integer score, Integer teamCount, Integer childCount, BigDecimal distributionAmount, Integer isCertification, String isCertificationName, String invitationCode, BigDecimal todayAchievement, Integer todayProfit, Integer todayCommission, BigDecimal amount, BigDecimal eCardNumber, Integer identityVip, String identityVipValue, String linkUrl, Date createTime, Date updateTime) {
		this.id = id;
		this.nickName = nickName;
		this.mobile = mobile;
		this.password = password;
		this.headimg = headimg;
		this.referrerName = referrerName;
		this.score = score;
		this.teamCount = teamCount;
		this.childCount = childCount;
		this.distributionAmount = distributionAmount;
		this.isCertification = isCertification;
		this.isCertificationName = isCertificationName;
		this.invitationCode = invitationCode;
		this.todayAchievement = todayAchievement;
		this.todayProfit = todayProfit;
		this.todayCommission = todayCommission;
		this.amount = amount;
		this.eCardNumber = eCardNumber;
		this.identityVip = identityVip;
		this.identityVipValue = identityVipValue;
		this.linkUrl = linkUrl;
	}

	public AuthUser() {
	    super();
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("id", getId())
			.append("nickName", getNickName())
			.append("mobile", getMobile())
			.append("password", getPassword())
			.append("headimg", getHeadimg())
			.append("referrerName", getReferrerName())
			.append("score", getScore())
			.append("teamCount", getTeamCount())
			.append("childCount", getChildCount())
			.append("distributionAmount", getDistributionAmount())
			.append("isCertification", getIsCertification())
			.append("isCertificationName", getIsCertificationName())
			.append("invitationCode", getInvitationCode())
			.append("todayAchievement", getTodayAchievement())
			.append("todayProfit", getTodayProfit())
			.append("todayCommission", getTodayCommission())
			.append("amount", getAmount())
			.append("eCardNumber", getECardNumber())
			.append("identityVip", getIdentityVip())
			.append("identityVipValue", getIdentityVipValue())
			.append("linkUrl", getLinkUrl())
			.append("createTime", getCreateTime())
			.append("updateTime", getUpdateTime())
		.toString();
	}

	public String dateToStringConvert(Date date) {
		if(date!=null) {
			return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
}